﻿@using EPiBoost.Core.Web.Mvc.Html
@model EPiServer.Core.PageDataCollection

@{
    var wrapperSettings = Helpers.LoadWrapperSetttings(Html);
    var rowSettings = Helpers.LoadRowSetttings(Html);
	int i = 0; 
	int total = Model.Count;
}

@foreach (var p in Model)
{
	Helpers.TryOpenRow(Html, rowSettings, i, total);
    
	var wrapperOpen = Helpers.OpenWrapper(Html, wrapperSettings, i, total, rowSettings);
    
    @Html.DisplayFor(m => p, new { wrapperSettings, rowSettings})

	if (wrapperOpen)
	{
		Helpers.CloseWrapper(Html, wrapperSettings);
	}

    Helpers.TryCloseRow(Html, rowSettings, i, total);

	i++;
}

